package edu.egypt.progressdialogsample;

import android.app.Activity;
import android.app.ProgressDialog;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class ProgressDialogSampleActivity extends Activity {
    private Button button;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        intializeUI();
    }

	private void intializeUI() {
		button = (Button)findViewById(R.id.button1);
		button.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				ProgressDialog p = new ProgressDialog(ProgressDialogSampleActivity.this);
				p.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
				p.setMessage("Loading...");
				p.setCancelable(true);
				p.incrementProgressBy(20);
				p.show();
				
			}
		});
	}
}